import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import validate from '@/components/validate' //表单验证
import datetimepicker from '@/components/datetimepicker' //日历
import lunbo from '@/components/lunbo' //轮播图
import lazyload from '@/components/lazyload' //懒加载
import actionsheet from '@/components/actionsheet' //上拉菜单
import mtloadmore from '@/components/mtloadmore' //上拉加载
import pickerslot from '@/components/pickerslot' //三级联动
import parenttochild from '@/components/parenttochild/parenttochild' //父传子
import childtoparent from '@/components/childtoparent/childtoparent' //子传父
import elepassbyvalue from '@/components/elepassbyvalue/elepassbyvalue' //非父子组件之间的传值
import parentcallchild from '@/components/incident/parentcallchild' //父调用子的方法
import productlist from '@/components/passvaluebyroute/productlist'
import productdetail from '@/components/passvaluebyroute/productdetail'
Vue.use(Router)

export default new Router({
	routes: [{
		path: '/',
		name: 'HelloWorld',
		component: HelloWorld,
		meta: {
			index: 1,
			title: '主页'
		}
	}, {
		path: '/validate',
		name: 'validate',
		component: validate,
		meta: {
			index: 2,
			title: '表单验证'
		}
	}, {
		path: '/datetimepicker',
		name: 'datetimepicker',
		component: datetimepicker,
		meta: {
			index: 2,
			title: '日期/时间'
		},
	}, {
		path: '/lunbo',
		name: 'lunbo',
		component: lunbo,
		meta: {
			index: 2,
			title: '轮播图'
		}
	}, {
		path: '/lazyload',
		name: 'lazyload',
		component: lazyload,
		meta: {
			index: 2,
			title: '懒加载'
		}
	}, {
		path: '/actionsheet',
		name: 'actionsheet',
		component: actionsheet,
		meta: {
			index: 2,
			title: '上拉菜单'
		}
	}, {
		path: '/mtloadmore',
		name: 'mtloadmore',
		component: mtloadmore,
		meta: {
			index: 2,
			title: '上拉加载/下拉刷新'
		}
	}, {
		path: '/pickerslot',
		name: 'pickerslot',
		component: pickerslot,
		meta: {
			index: 2,
			title: '三级联动'
		}
	}, {
		path: '/parenttochild',
		name: 'parenttochild',
		component: parenttochild,
		meta: {
			index: 2,
			title: '父传子'
		}
	}, {
		path: '/childtoparent',
		name: 'childtoparent',
		component: childtoparent,
		meta: {
			index: 2,
			title: '子传父'
		}
	}, {
		path: '/elepassbyvalue',
		name: 'elepassbyvalue',
		component: elepassbyvalue,
		meta: {
			index: 2,
			title: '非父子传值'
		}
	}, {
		path: '/parentcallchild',
		name: 'parentcallchild',
		component: parentcallchild,
		meta: {
			index: 2,
			title: '父调用子方法'
		}
	}, {
		path: '/productlist',
		name: 'productlist',
		component: productlist,
		meta: {
			index: 2,
			title: '产品列表'
		}
	}, {
		path: '/productdetail',
		name: 'productdetail',
		component: productdetail,
		meta: {
			index: 3,
			title: '产品详情'
		}
	}]
})